package com.baseframe.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baseframe.system.entity.BasePermission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**

* @description 针对表【base_permission(权限表)】的数据库操作Mapper
* @createDate 2023-05-20 19:25:46
* @Entity com.baseframe.system.entity.BasePermission
*/
public interface BasePermissionMapper extends BaseMapper<BasePermission> {

    @Select("select p.* from base_role as r left join base_permission as p on p.id in(select rs.permission_id from base_role_scope as rs where rs.role_id=r.id) where r.id = #{roleId};")
    List<BasePermission> selectPermissionsByRoleId(@Param("roleId") Long roleId);
}




